package com.huawei.skinner.base;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.LayoutInflater.Factory2;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import o.fle;
import o.fmt;
import o.fv;
import o.LayoutInflaterCompatHC;
import o.FragmentManager;

public class SkinBaseFragment extends Fragment implements fle {
    private boolean ˊ = true;
    private fle ˋ;

    public void ॱ(Context context) {
        super.ॱ(context);
        if (context instanceof fle) {
            this.ˋ = (fle) context;
        }
    }

    public void ˊ(View view, @Nullable Bundle bundle) {
        Object obj = 1;
        super.ˊ(view, bundle);
        if (!this.ˊ) {
            Object obj2;
            Fragment ˈ = ˈ();
            if (ˈ == null || !(ˈ instanceof SkinBaseFragment) || ((SkinBaseFragment) ˈ).ˊ) {
                int i = 1;
            } else {
                obj2 = null;
            }
            FragmentActivity ॱˋ = ॱˋ();
            boolean ᐝ;
            if (ॱˋ instanceof SkinBaseFragmentActivity) {
                ᐝ = ((SkinBaseFragmentActivity) ॱˋ).ᐝ();
            } else {
                ᐝ = true;
            }
            Object obj3 = (ˈ == null || obj2 == null) ? null : 1;
            if (!(ˈ == null && r5)) {
                obj = null;
            }
            if (obj3 != null || r4 != null) {
                view.setBackgroundColor(fv.ˏ(ᐝॱ(), 17170443, ॱˋ().getTheme()));
            }
        }
    }

    public void ˊ(View view, String str, int i) {
        if (this.ˊ && this.ˋ != null) {
            this.ˋ.ˊ(view, str, i);
        }
    }

    @NonNull
    public LayoutInflater ॱ(@Nullable Bundle bundle) {
        if (!ॱ()) {
            FragmentManager ʽॱ = ʽॱ();
            if (ʽॱ instanceof Factory2) {
                LayoutInflater cloneInContext = ॱˋ().getLayoutInflater().cloneInContext(ॱˊ());
                fmt.ˏ(LayoutInflater.class, cloneInContext, "mFactory", null);
                fmt.ˏ(LayoutInflater.class, cloneInContext, "mFactory2", null);
                LayoutInflaterCompatHC.setLayoutInfaltorFactory2(cloneInContext, (Factory2) ʽॱ);
                return cloneInContext;
            }
        }
        return super.ॱ(bundle);
    }

    public boolean ॱ() {
        return this.ˊ;
    }
}
